package com.shengqiang.cloud.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Administrator on 2017/11/1.
 */
@RestController
@RequestMapping(value = "test")
public class ServiceTest {

    @Autowired
    private DiscoveryClient discoveryClient;

    @RequestMapping(value = "provideTest")
    public String provideTest(){

        String services="Services:"+discoveryClient.getServices().toString();
        System.out.println(services);
        return "Hello Spring Cloud";
    }
}
